/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fivonacci;

import java.io.BufferedReader;
import java.io.InputStreamReader;

/**
 *
 * @author Richard
 */
public class Fivonacci{
        static Leer leer = new Leer();
	public static void main(String[] args){
            InputStreamReader is = new InputStreamReader(System.in); 
            BufferedReader br = new BufferedReader(is);
		int a = 0;
		int b = 1;
		int c = 0;
		int suma =0;
		int buscar;
                
                    System.out.println("Ingrese el termino a hallar");
                    buscar = leer.DatoInt();
                
                System.out.print("0");
		for (int h = 1; h < buscar; h++){
			c = a+b;
			b= a;
			a= c;
			suma = a + suma;
                        System.out.print(" + "+ c);
		}
		System.out.println(" = " +suma);
	}
}
